package com.qq.employee.dao;

import com.qq.employee.utity.Attendance;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AttendanceMapper {

    @Select("select * from attendance")
    List<Attendance> listAttendance();
    @Insert("insert into attendance (name,employeeId,dept,reason,attendanceDate)  values (#{name},#{employeeId},#{dept},#{reason},#{attendanceDate})")
    int insertAttendance(Attendance attendance);
    @Delete("delete from attendance where id = #{id}")
    int deleteAttendance(int id);
    @Update("update attendance set name = #{name},employeeId = #{employeeId}, dept = #{dept}, reason = #{reason},attendanceDate = #{attendanceDate} where id = #{id}")
    int updateAttendance(Attendance attendance);
    @Select("select *from attendance where id=#{id}")
    Attendance get(int id);
}
